-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid encoding VT via win32 input mode #16407
Conversation
There's another bug for this as well. Mouse mode one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it doesn't fix the mouse mode one. But it's a good start!
src/host/inputBuffer.cpp
Outdated
@@ -602,6 +602,30 @@ size_t InputBuffer::Write(const std::span<const INPUT_RECORD>& inEvents) | |||
} | |||
} | |||
|
|||
void InputBuffer::WriteDirect(const std::span<const INPUT_RECORD>& inEvents) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of creating a new method for this, couldn't you just make the existing _HandleTerminalInputCallback
method public, and call it with a string instead of an event list? That way you could drop all that event generation code from the ReturnResponse
method, and pass the string through directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's a good point. I'll make that change.
ServiceLocator::LocateGlobals().hInputEvent.SetEvent(); | ||
} | ||
|
||
WakeUpReadersWaitingForData(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_HandleTerminalInputCallback
doesn't wake up readers if there were no bits - should we do that here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was a bit afraid of outright using _HandleTerminalInputCallback
, because InputBuffer::Write
actually does it exactly like that: It always calls WakeUpReadersWaitingForData()
. In the future, if I ever get to rewrite InputBuffer
with proper string support, I was hoping to really understand how this works and to properly unify the event/wakeup code.
This changeset avoids re-encoding output from `AdaptDispatch` via the win32-input-mode mechanism when VT input is enabled. That is, an `AdaptDispatch` output like `\x1b[C` would otherwise result in dozens of characters of input. Related to #16343 ## Validation Steps Performed * Replace conhost with this * Launch a Win32 application inside WSL * ASCII keyboard inputs are represented as single `INPUT_RECORD`s ✅ (cherry picked from commit 0da37a1) Service-Card-Id: 91246942 Service-Version: 1.19
This changeset avoids re-encoding output from
AdaptDispatch
via the win32-input-mode mechanism when VT input is enabled.
That is, an
AdaptDispatch
output like\x1b[C
would otherwiseresult in dozens of characters of input.
Related to #16343
Validation Steps Performed
INPUT_RECORD
s ✅